/*
    This file is part of Raptor.

    Raptor is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Raptor is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Raptor.  If not, see <http://www.gnu.org/licenses/>.

 */

#ifndef INTERFACEURLCONTAINER_H
#define INTERFACEURLCONTAINER_H

#include <QObject>
#include <QHttp>
#include <QString>
#include <QUrl>
#include <QTemporaryFile>
#include <QPointer>
#include <QNetworkProxy>

class InterfaceUrlContainer
{
    public:

        InterfaceUrlContainer() {};
        virtual ~InterfaceUrlContainer() {};

        virtual void start(QUrl const& url, QString const& captchaDir) { Q_UNUSED(url); Q_UNUSED(captchaDir); };
        virtual void abort() {};

        virtual void setProxy(QNetworkProxy const& proxy) { Q_UNUSED(proxy); };

        virtual void setCaptcha(QString const& captcha) { Q_UNUSED(captcha); };
        virtual bool isValidUrl(QUrl const& url) { Q_UNUSED(url); return false; };

        virtual QString errorString() { return _errorString; };
        //virtual void setCaptchaDir(QString const& captchaDir) { _captchaDir = captchaDir; };

    protected:

        QHttp http;
        QString _errorString;
        QPointer<QTemporaryFile> _captchaFile;
        QString _captchaDir;
        bool _abort;
};

Q_DECLARE_INTERFACE(InterfaceUrlContainer, "org.raptor-loader.Plugin.InterfaceUrlContainer/1.0");

#endif // INTERFACEURLCONTAINER_H
